function [rho, sos] = MCAtmosphere(Height)
hkm = 0.001*Height;
if Height <= 0.1
    hkm = 0.0001;
end
temp_air = nan;
if (hkm >= 80)
    temp_air = 196.65;
elseif (hkm >= 71)
    temp_air = 214.65 + (hkm - 71)*(-2);
elseif (hkm >= 51)
    temp_air = 270.65 + (hkm - 51)*(-2.8);
elseif (hkm >= 47)
    temp_air = 270.65;
elseif (hkm >= 32)
    temp_air = 228.65 + (hkm - 32)*2.8;
elseif (hkm >= 20)
    temp_air = 216.65 + (hkm - 20);
elseif (hkm >= 11)
    temp_air = 216.65;
elseif (hkm >= 0)
    temp_air = 288.15 + (hkm)*(-6.5);
end
sos = 20.0463*sqrt(temp_air);
if (hkm > 80)
    rho = 0;
elseif (hkm > 40)
    rho = 4.67728157*exp(-0.21078027*hkm + 0.00084729*hkm * hkm);
elseif (hkm > 5)
    rho = 1.01617989*exp(-0.03025348*hkm - 0.00798467*hkm.^2 + 0.00020906*hkm.^3 - 0.00000193*hkm.^4);
else
    rho = 1.22458915 - 0.11655767*hkm + 0.0038012*hkm.^2;
end
rho = normrnd(rho,rho*0.1);
end     